package com.kczd.jinlan.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.kczd.jinlan.R;
import com.kczd.jinlan.activity.CouponActivity;
import com.kczd.jinlan.activity.EditDataActivity;
import com.kczd.jinlan.activity.EvaluateActivity;
import com.kczd.jinlan.activity.SecurityActivity;
import com.kczd.jinlan.activity.SetupActivity;
import com.kczd.jinlan.activity.WalletActivity;

/**
 * yang_g
 * 我的模块
 * Created by Administrator on 2017/5/15.
 */

public class MyFragment extends BaseFragment implements View.OnClickListener {
    private View view;
    private TextView text_personal_data;//个人资料
    private LinearLayout linear_security;//安全中心
    private LinearLayout linear_evaluate;//我的评价
    private LinearLayout linear_Set_up;//设置
    private TextView text_Coupon;//优惠卷
    private TextView text_wallet;//钱包
    private ImageView image_view_my;//头像

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.my_fragment, null);
        init();
        return view;
    }

    private void init() {
        text_personal_data = (TextView) view.findViewById(R.id.text_personal_data);
        text_personal_data.setOnClickListener(this);
        linear_security = (LinearLayout) view.findViewById(R.id.linear_security);
        linear_security.setOnClickListener(this);
        linear_Set_up = (LinearLayout) view.findViewById(R.id.linear_Set_up);
        linear_Set_up.setOnClickListener(this);
        text_Coupon = (TextView) view.findViewById(R.id.text_Coupon);
        text_Coupon.setOnClickListener(this);
        text_wallet = (TextView) view.findViewById(R.id.text_wallet);
        text_wallet.setOnClickListener(this);
        image_view_my = (ImageView) view.findViewById(R.id.image_view_my);
        image_view_my.setOnClickListener(this);
        linear_evaluate = (LinearLayout) view.findViewById(R.id.linear_evaluate);
        linear_evaluate.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.text_personal_data://个人资料
                gotoActivity(getContext(), EditDataActivity.class);
                break;
            case R.id.linear_security://安全中心
                gotoActivity(getContext(), SecurityActivity.class);
                break;
            case R.id.linear_Set_up://设置
                gotoActivity(getContext(), SetupActivity.class);
                break;
            case R.id.text_Coupon://优惠卷
                gotoActivity(getContext(), CouponActivity.class);
                break;
            case R.id.text_wallet://钱包
                gotoActivity(getContext(), WalletActivity.class);
                break;
            case R.id.image_view_my://头像

                break;
            case R.id.linear_evaluate://我的评价
                gotoActivity(getContext(), EvaluateActivity.class);
                break;
        }
    }
}
